<?php
/*
Plugin Name: VPS cformsII Extenstion
Plugin URI: http://www.vancouverpride.ca
Description: Extension to cForms
Author: Martin Wulff & Emily Sors
Author URI: http://www.vancouverpride.ca
Version: 0.1
*/

// Hook for adding admin menus

    add_action('admin_menu', 'vce_add_pages');

// action function for above hook
function vce_add_pages() {

  	function flexscript(){
		$cformsSettings = get_option('cforms_settings');
		$plugindir   = $cformsSettings['global']['plugindir'];

		$r = $cformsSettings['global']['cforms_root'];
    		wp_register_script('cforms_interface',$r.'/js/interface.js',false,$localversion);
    		wp_register_script('cforms_admin',$r.'/js/cformsadmin.js',false,$localversion);

    		wp_enqueue_script('cforms_interface');
    		wp_enqueue_script('cforms_admin');
	   ### wp_enqueue_script(WP_PLUGIN_URL.'/vps-cforms-ext/flexigrid.js');
	   ###echo "   <script type='text/javascript' src='".WP_PLUGIN_URL."/vps-cforms-ext/flexigrid.js'></script>";
 	   }
	function flexcss( ){
	   echo "   <link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL."/vps-cforms-ext/css/flexigrid/flexigrid.css'>";
	   echo "   <link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL."/vps-cforms-ext/css/jqModal.css'>";
	   }
	function jqgridcss( ){
	   echo "   <link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL."/vps-cforms-ext/css/jquery-ui-1.8.9.custom.css'>";
	   echo "   <link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL."/vps-cforms-ext/css/ui.jqgrid.css'>";
	   }
	function jqgridscript( ){
    		wp_register_script('jqgrid_core',WP_PLUGIN_URL.'/vps-cforms-ext/lib/i18n/grid.locale-en.js',array('jquery'),$localversion);
    		wp_register_script('jqgrid_lang',WP_PLUGIN_URL.'/vps-cforms-ext/lib/jquery.jqGrid.min.js',array('jqgrid_core'),$localversion);

    		wp_enqueue_script('jqgrid_core');
    		wp_enqueue_script('jqgrid_lang');
    		wp_deregister_script('fep-forms-passmeter');
    		wp_deregister_script('fep-forms-script');
	   }
	
	function pricingcss( ) {
		echo "   <link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL."/vps-cforms-ext/css/vps-cforms-ext.css'>";
	}
	
	function pricingscript( ) {
	}

	function register_vpsprices() {
		//register our settings
		register_setting( 'vps-prices-group', 'vps_date_earlybird' );
		register_setting( 'vps-prices-group', 'vps_prices_earlybird' );
		register_setting( 'vps-prices-group', 'vps_date_latefee' );
		register_setting( 'vps-prices-group', 'vps_prices_latefee' );
		register_setting( 'vps-prices-group', 'vps_prices_art_march' );
		register_setting( 'vps-prices-group', 'vps_prices_art_float' );
		register_setting( 'vps-prices-group', 'vps_prices_art_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_art_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_art_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_np1_march' );
		register_setting( 'vps-prices-group', 'vps_prices_np1_float' );
		register_setting( 'vps-prices-group', 'vps_prices_np1_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_np1_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_np1_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_np2_march' );
		register_setting( 'vps-prices-group', 'vps_prices_np2_float' );
		register_setting( 'vps-prices-group', 'vps_prices_np2_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_np2_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_np2_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_bs1_march' );
		register_setting( 'vps-prices-group', 'vps_prices_bs1_float' );
		register_setting( 'vps-prices-group', 'vps_prices_bs1_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_bs1_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_bs1_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_bs2_march' );
		register_setting( 'vps-prices-group', 'vps_prices_bs2_float' );
		register_setting( 'vps-prices-group', 'vps_prices_bs2_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_bs2_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_bs2_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_bs3_march' );
		register_setting( 'vps-prices-group', 'vps_prices_bs3_float' );
		register_setting( 'vps-prices-group', 'vps_prices_bs3_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_bs3_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_bs3_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_gov_march' );
		register_setting( 'vps-prices-group', 'vps_prices_gov_float' );
		register_setting( 'vps-prices-group', 'vps_prices_gov_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_gov_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_gov_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_con_march' );
		register_setting( 'vps-prices-group', 'vps_prices_con_float' );
		register_setting( 'vps-prices-group', 'vps_prices_con_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_con_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_con_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_hdg_march' );
		register_setting( 'vps-prices-group', 'vps_prices_hdg_float' );
		register_setting( 'vps-prices-group', 'vps_prices_hdg_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_hdg_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_hdg_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_mfu_march' );
		register_setting( 'vps-prices-group', 'vps_prices_mfu_float' );
		register_setting( 'vps-prices-group', 'vps_prices_mfu_esp' );
		register_setting( 'vps-prices-group', 'vps_prices_mfu_dsdp' );
		register_setting( 'vps-prices-group', 'vps_prices_mfu_sb' );
		register_setting( 'vps-prices-group', 'vps_prices_chair' );
		register_setting( 'vps-prices-group', 'vps_prices_table' );
		register_setting( 'vps-prices-group', 'vps_prices_tent' );
		register_setting( 'vps-prices-group', 'vps_prices_foodprep' );
	}

    // Add a new top-level menu:
    add_menu_page(__('VPS Forms','vps-forms'), __('VPS Forms','vps-forms'), 'vps_manager', 'vce-forms-top', 'vce_forms_page', get_template_directory_uri().'/images/theme.png' );

    // Add a submenu to manage pricing:
    $page3=add_submenu_page('vce-forms-top', __('Manage Pricing','vps-forms'), __('Manage Pricing','vps-forms'), 'vps_manager', 'manage_pricing', 'vce_manage_pricing');
    add_action( "admin_print_styles-$page3", pricingcss );
    add_action( "admin_print_scripts-$page3", pricingscript );
	add_action( 'admin_init', 'register_vpsprices' );

    // Add a submenu to track changes:
    $page1=add_submenu_page('vce-forms-top', __('Track Entries','vps-forms'), __('Track Entries','vps-forms'), 'manage_options', 'track_entries', 'vce_track_entries');

    add_action( "admin_print_styles-$page1", flexcss );    
    add_action( "admin_print_scripts-$page1", flexscript );

	
    // Add a submenu to test jgrid:
    $page2=add_submenu_page('vce-forms-top', __('jqGrid List','vps-forms'), __('jqGrid List','vps-forms'), 'manage_options', 'jqgrid_list', 'vce_jqgrid_list');
    add_action( "admin_print_styles-$page2", jqgridcss );
    add_action( "admin_print_scripts-$page2", jqgridscript );
   
	
}


// vce_forms_page() displays the page content for the custom Test Toplevel menu
function vce_forms_page() { 
?>
    
	<div class="wrap" id="top">
    <h2>VPS Forms</h2>
	</div>
<?php
}

// vce_track_entries() displays the page content for the first submenu
// of the custom Test Toplevel menu
function vce_track_entries() {
	if (!current_user_can('manage_options'))  {
		wp_die( __('You do not have sufficient permissions to access this page.') );
	}
###echo "   <script type='text/javascript' src='".WP_PLUGIN_URL."/vps-cforms-ext/flexigrid.js'></script>";
###echo "   <script type='text/javascript' src='".WP_PLUGIN_URL."/vps-cforms-ext/cformsadmin.js'></script>";

### DB settings
global $wpdb;
$wpdb->cformssubmissions	= $wpdb->prefix . 'cformssubmissions';
$wpdb->cformsdata       	= $wpdb->prefix . 'cformsdata';

### Check Whether User Can Manage Database
check_access_priv('track_cforms');

### New global settings container, will eventually be the only one!
$cformsSettings = get_option('cforms_settings');
$plugindir   = $cformsSettings['global']['plugindir'];

$cforms_root = $cformsSettings['global']['cforms_root'];

### check if pre-9.0 update needs to be made
if( $cformsSettings['global']['update'] )
	require_once (dirname(__FILE__) . '/update-pre-9.php');

### if all data has been erased quit
if ( check_erased() )
	return;

### check for abspath.php
abspath_check();
   ?>
    <div class="wrap" id="top">
	<h2><?php _e('Tracking Entries','vps-forms')?></h2>

	<p><?php _e('All your recorded form submissions are listed below. View individual entries or a whole bunch and download as XML, TAB or CSV formatted file. Attachments can be accessed in the details section (<strong>View records</strong>). When deleting entries, associated attachments will be removed, too! ', 'vps-forms') ?></p>

	<p class="ex" style="margin-bottom:30px;"><?php _e('If you want to select <strong>ALL</strong> entries, e.g. for download, simply don\'t select any particular row. When <strong>viewing records</strong>: Fields with a <em>grey background</em> can be clicked on and edited!', 'vps-forms') ?></p>

	<div id="ctrlmessage"></div>
	<div class="bborderx"><table id="flex1" style="display:none"><tr><td></td></tr></table></div>
	<div id="entries"></div>
	<div id="geturl" title="/"></div>

	<?php
	### if called from dashboard
	$dashboard = '';
    if ( $_GET['d-id'] ){
	    $dashboard = "qtype: 'id', query: '".$_GET['d-id']."',";
	}
	?>

<script type="text/javascript">
jQuery("#flex1").flexigrid ( {
	url: '<?php echo WP_PLUGIN_URL.'/vps-cforms-ext/lib_database_getentries_json.php'; ?>',
	dataType: 'json',
	colModel : [
		{display: '#', name : 'id', width : 40, sortable : true, align: 'center'},
		{display: '<?php _e('Form Name','vps-forms'); ?>', name : 'form_id', width : 240, sortable : true, align: 'center'},
		{display: '<?php _e('e-mail Address','vps-forms'); ?>', name : 'email', width : 200, sortable : true, align: 'center'},
		{display: '<?php _e('Date','vps-forms'); ?>', name : 'sub_date', width : 160, sortable : true, align: 'center'},
		{display: '<?php _e('IP','vps-forms'); ?>', name : 'ip', width : 100, sortable : true, align: 'center'}
		],
	buttons : [
		{name: '<?php _e('View records','cforms'); ?>', bclass: 'add', onpress : cf_tracking_view},
		{name: '<?php _e('Delete records','vps-forms'); ?>', bclass: 'delete', onpress : function (){jQuery('#cf_delete_dialog').jqmShow();} },
		{name: '<?php _e('Download records','vps-forms'); ?>', bclass: 'dl', onpress : function (){jQuery('#cf_dl_dialog').jqmShow();}},
		{separator: true}
		],
	searchitems : [
		{display: '<?php _e('# Number(s)','vps-forms'); ?>', name : 'id'},
		{display: '<?php _e('Form Name','vps-forms'); ?>', name : 'form_id'},
		{display: '<?php _e('e-mail Address','vps-forms'); ?>', name : 'email', isdefault: true},
		{display: '<?php _e('Date','vps-forms'); ?>', name : 'sub_date'},
		{display: '<?php _e('IP','vps-forms'); ?>', name : 'ip'}
		],<?php echo $dashboard; ?>
	sortname: "id",
	sortorder: "desc",
	usepager: true,
	title: '<?php _e('Form Submissions','vps-forms'); ?>',
	errormsg: '<?php _e('Connection Error','vps-forms'); ?>',
	pagestat: '<?php _e('Displaying {from} to {to} of {total} items','vps-forms'); ?>',
	procmsg: '<?php _e('Processing, please wait ...','vps-forms'); ?>',
	nomsg: '<?php _e('No items','vps-forms'); ?>',
	pageof: '<?php _e('Page {%1} of','vps-forms'); ?>',
	useRp: true,
	blockOpacity: 0.9,
	rp: 30,
	rpOptions: [10,30,50,100,200],
	showTableToggleBtn: true,
	width: 820,
	height: 250 });
</script>
<?php
### if called from dashboard
if ( $_GET['d-id'] ){
	$_POST['showids'] = $_GET['d-id'].',';
	include_once( 'js/include/lib_database_getentries.php' );
}

###cforms_footer();
?>
</div> <!-- wrap -->

<?php
add_action('admin_footer', 'insert_cfmodal_tracking');
function insert_cfmodal_tracking(){
	global $cforms_root,$noDISP;

	### Temp storage for download data
	$tempfile = dirname(__FILE__)."/data.tmp";
?>
	<div class="jqmWindow" id="cf_delete_dialog">
		<div class="cf_ed_header jqDrag"><?php _e('Please Confirm','vps-forms'); ?></div>
		<div class="cf_ed_main">
			<form action="" name="deleteform" method="post">
				<div id="cf_target_del"><?php _e('Are you sure you want to delete the record(s)?','vps-forms'); ?></div>
				<div class="controls"><a href="#" id="okDelete" class="jqmClose"><img src="<?php echo $cforms_root; ?>/images/dialog_ok.gif" alt="<?php _e('Install', 'vps-forms') ?>" title="<?php _e('OK', 'vps-forms') ?>"/></a><a href="#" class="jqmClose"><img src="<?php echo $cforms_root; ?>/images/dialog_cancel.gif" alt="<?php _e('Cancel', 'vps-forms') ?>" title="<?php _e('Cancel', 'vps-forms') ?>"/></a></div>
			</form>
		</div>
	</div>
	<div class="jqmWindow" id="cf_dl_dialog">
		<div class="cf_ed_header jqDrag"><?php _e('Please Confirm','cforms'); ?></div>
		<div class="cf_ed_main">
			<form action="" name="downloadform" method="post" id="downloadform">
				<?php if( is_writable($tempfile) ) : ?>
				<div id="cf_target_dl">
                    <select id="pickDLformat" name="format">
                        <option value="xml">&nbsp;&nbsp;&nbsp;XML&nbsp;&nbsp;&nbsp;</option>
                        <option value="csv">&nbsp;&nbsp;&nbsp;CSV&nbsp;&nbsp;&nbsp;</option>
                        <option value="tab">&nbsp;&nbsp;&nbsp;TAB&nbsp;&nbsp;&nbsp;</option>
                    </select><label for="pickDLformat"><?php echo sprintf(__('Please pick a format!','cforms')); ?></label>
                    <br />
                    <input type="radio" class="chkBoxW" id="enc-utf8" name="enc" value="utf-8"/><label for="enc-utf8"><?php echo sprintf(__('UTF-8','cforms')); ?></label>
                    <input type="radio" class="chkBoxW" id="enc-iso" name="enc" value="iso" checked="checked"/><label for="enc-iso"><?php echo sprintf(__('ISO-8859-1','cforms')); ?></label>
                    <br />
                    <input type="checkbox" class="chkBoxW" id="header" name="header" value="true"/><label for="header"><?php echo sprintf(__('Include field names / header','cforms')); ?></label><br />
                    <input type="checkbox" class="chkBoxW" id="addip" name="addip" value="true"/><label for="addip"><?php echo sprintf(__('Include IP address of submitting user','cforms')); ?></label><br />
                    <input type="checkbox" class="chkBoxW" id="addurl" name="addurl" value="true"/><label for="addurl"><?php echo sprintf(__('Add URL for upload fields','cforms')); ?></label>
				</div>
                <?php else :
                    echo '<p><strong>'.sprintf( __('File (data.tmp) in %s not writable! %sPlease adjust its file permissions/ownership!','cforms'),'<br />&nbsp;&nbsp;&nbsp;<code>'.dirname(__FILE__).'</code><br />','<br />').'</strong></p>';
                    echo '<p><strong>'.sprintf( __('...and reload this page afterwards.','cforms')).'</strong></p>';
                    endif; ?>
				<div class="controls"><?php if( is_writable($tempfile) ) : ?><a href="#" id="okDL" class="jqmClose"><img src="<?php echo $cforms_root; ?>/images/dialog_ok.gif" alt="<?php _e('Install', 'cforms') ?>" title="<?php _e('OK', 'cforms') ?>"/></a><?php endif; ?><a href="#" class="jqmClose"><img src="<?php echo $cforms_root; ?>/images/dialog_cancel.gif" alt="<?php _e('Cancel', 'cforms') ?>" title="<?php _e('Cancel', 'cforms') ?>"/></a></div>
			</form>
		</div>
	</div>
<?php
}
}
// vce_jqgrid_list() displays the page content for the second submenu
// of the custom Test Toplevel menu
function vce_jqgrid_list() { 
	if (!current_user_can('manage_options'))  {
		wp_die( __('You do not have sufficient permissions to access this page.') );
	}
	
	?>
<script type="text/javascript">
var j = jQuery.noConflict();
j(function(){ 
  j("#list").jqGrid({
					url:'<?php echo WP_PLUGIN_URL.'/vps-cforms-ext/lib_database_getentries_json.php'; ?>',
					datatype: 'json',
					mtype: 'GET',
					colNames:['ID','Date', 'Type','Status','Name','Organization','E-mail'],
					colModel :[ 
						{name:'id', index:'id', width:20}, 
						{name:'date', index:'date', width:90}, 
						{name:'application', index:'application', width:80, align:'center'}, 
						{name:'status', index:'status', width:80, align:'center'}, 
						{name:'name', index:'name', width:150, align:'center'}, 
						{name:'organization', index:'organization', width:120, align:'center'},
						{name:'email', index:'email', width:200, sortable:false} 
					],
					defaults : {
						recordtext: "View {0} - {1} of {2}",
						emptyrecords: "No records to view",
						loadtext: "Loading...",
						pgtext : "Page {0} of {1}"
					},
					grouping: false,
 					pager: '#pager',
					loadonce: true,
					rowNum:10,
					rowList:[10,20,30],
					sortname: 'id',
					sortorder: 'desc',
					viewrecords: true,
					multiselect: true,
					caption: 'Submitted Forms'
					}).navGrid("#pager",{edit:false,add:false,del:false,csv:true});
					jQuery("#m1").click( function() {
					  var s;
					  s = jQuery("#list").jqGrid('getGridParam','selarrrow');
					  document.forms[0].sBuffer.value=s;
					  document.forms[0].method='GET';
					  document.forms[0].action='export_report.php';  // send it to server which will open this contents in excel file
					  document.forms[0].target='_blank';
					  document.forms[0].submit();});
  });
</script>
	<div class="wrap" id="top">
	<h2><?php _e('Tracking Entries -jqGrid','vps-forms')?></h2>

	<p><?php _e('All your recorded form submissions are listed below. View individual entries or a whole bunch and download as XML, TAB or CSV formatted file. Attachments can be accessed in the details section (<strong>View records</strong>). When deleting entries, associated attachments will be removed, too! ', 'vps-forms') ?></p>

	<p class="ex" style="margin-bottom:30px;"><?php _e('If you want to select <strong>ALL</strong> entries, e.g. for download, simply don\'t select any particular row. When <strong>viewing records</strong>: Fields with a <em>grey background</em> can be clicked on and edited!', 'vps-forms') ?></p>

	Select Type: <select id="chntype">
		<option value="Vendor">Vendor</option>
		<option value="Parade">Parade</option>
		<option value="clear">All</option>	
	</select>
	<table id="list"></table> 
	<div id="pager"></div>
	<a href="javascript:void(0)" id="m1">Get Selected id's</a>
	</div>
<?php 

}


// vce_manage_pricing() displays the page content for the second submenu
// of the custom Test Toplevel menu
function vce_manage_pricing() { 
	if (!current_user_can('vps_manager'))  {
		wp_die( __('You do not have sufficient permissions to access this page.') );
	}
	?>

    <div class="wrap" id="top">
	<?php if ( isset( $_GET['settings-updated'] ) && 'true' == esc_attr( $_GET['settings-updated'] ) )  {
		echo "<div id='message' class='updated'><p>", __("Settings Saved", "vps-options"), "</p></div>";
	}
	?>
	<h2><?php _e('Manage Pricing','vps-forms')?></h2>
	
	<p><i><?php _e('Use this screen to update pricing models and cut off dates', 'vps-forms') ?></i></p>
	
<form method="post" action="options.php">
<?php settings_fields( 'vps-prices-group' ); ?>
<h3>Early Bird and Late Fee Settings</h3>
<table class="form-table">
<tbody class="vps-form">
<tr valign="top">
<th scope="row">Early Bird Cut-off Date</th>
<td><input type="text" name="vps_date_earlybird" value="<?php echo get_option('vps_date_earlybird'); ?>" /> (YYYY-MM-DD)</td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Early Bird Discount Percentage</th>
<td><input type="text" name="vps_prices_earlybird" value="<?php echo get_option('vps_prices_earlybird'); ?>" />%</td>
</tr>
<tr valign="top">
<th scope="row">Late Fee Start Date</th>
<td><input type="text" name="vps_date_latefee" value="<?php echo get_option('vps_date_latefee'); ?>" /> (YYYY-MM-DD)</td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Late Fee Amount</th>
<td>$<input type="text" name="vps_prices_latefee" value="<?php echo get_option('vps_prices_latefee'); ?>" /></td>
</tr>
</tbody>
</table>
<H3>Pride Parade and Festival Fees</H3>
<table class="form-table">
<tbody class="vps-form">
<tr valign="top" class="headers">
<th scope="row">Organization Type</th>
<td align="center"><font size="2em">Parade - Marching</font></td>
<td align="center"><font size="2em">Parade - Float</font></td>
<td align="center"><font size="2em">East Side Pride</font></td>
<td align="center"><font size="2em">Davie Street Dance Party</font></td>
<td align="center"><font size="2em">Sunset Beach</font></td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Artisan/Performer</th>
<td>$<input type="text" size="20px" name="vps_prices_art_march" value="<?php echo get_option('vps_prices_art_march'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_art_float" value="<?php echo get_option('vps_prices_art_float'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_art_esp" value="<?php echo get_option('vps_prices_art_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_art_dsdp" value="<?php echo get_option('vps_prices_art_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_art_sb" value="<?php echo get_option('vps_prices_art_sb'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Non-profit Society or Charity with budget of $1m or less</th>
<td>$<input type="text" size="20px" name="vps_prices_np1_march" value="<?php echo get_option('vps_prices_np1_march'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np1_float" value="<?php echo get_option('vps_prices_np1_float'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np1_esp" value="<?php echo get_option('vps_prices_np1_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np1_dsdp" value="<?php echo get_option('vps_prices_np1_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np1_sb" value="<?php echo get_option('vps_prices_np1_sb'); ?>" /></td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Non-profit Society or Charity with budget of more than $1m</th>
<td>$<input type="text" size="20px" name="vps_prices_np2_march" value="<?php echo get_option('vps_prices_np2_march'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np2_float" value="<?php echo get_option('vps_prices_np2_float'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np2_esp" value="<?php echo get_option('vps_prices_np2_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np2_dsdp" value="<?php echo get_option('vps_prices_np2_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_np2_sb" value="<?php echo get_option('vps_prices_np2_sb'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Business with a single location only</th>
<td align="center">N/A</td>
<td>$<input type="text" size="20px" name="vps_prices_bs1_float" value="<?php echo get_option('vps_prices_bs1_float'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs1_esp" value="<?php echo get_option('vps_prices_bs1_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs1_dsdp" value="<?php echo get_option('vps_prices_bs1_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs1_sb" value="<?php echo get_option('vps_prices_bs1_sb'); ?>" /></td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Business or Crown Corporation in Vancouver or BC only</th>
<td align="center">N/A</td>
<td>$<input type="text" size="20px" name="vps_prices_bs2_float" value="<?php echo get_option('vps_prices_bs2_float'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs2_esp" value="<?php echo get_option('vps_prices_bs2_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs2_dsdp" value="<?php echo get_option('vps_prices_bs2_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs2_sb" value="<?php echo get_option('vps_prices_bs2_sb'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Business or Crown Corporation with National or International locations</th>
<td align="center">N/A</td>
<td>$<input type="text" size="20px" name="vps_prices_bs3_float" value="<?php echo get_option('vps_prices_bs3_float'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs3_esp" value="<?php echo get_option('vps_prices_bs3_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs3_dsdp" value="<?php echo get_option('vps_prices_bs3_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_bs3_sb" value="<?php echo get_option('vps_prices_bs3_sb'); ?>" /></td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Government or Union Organization</th>
<td>$<input type="text" size="20px" name="vps_prices_gov_march" value="<?php echo get_option('vps_prices_gov_march'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_gov_float" value="<?php echo get_option('vps_prices_gov_float'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_gov_esp" value="<?php echo get_option('vps_prices_gov_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_gov_dsdp" value="<?php echo get_option('vps_prices_gov_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_gov_sb" value="<?php echo get_option('vps_prices_gov_sb'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Concession (Pop Corn/Ice Cream etc)</th>
<td align="center">N/A</td>
<td align="center">N/A</td>
<td>$<input type="text" size="20px" name="vps_prices_con_esp" value="<?php echo get_option('vps_prices_con_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_con_dsdp" value="<?php echo get_option('vps_prices_con_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_con_sb" value="<?php echo get_option('vps_prices_con_sb'); ?>" /></td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Hot Dog/Smokie Cart</th>
<td align="center">N/A</td>
<td align="center">N/A</td>
<td>$<input type="text" size="20px" name="vps_prices_hdg_esp" value="<?php echo get_option('vps_prices_hdg_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_hdg_dsdp" value="<?php echo get_option('vps_prices_hdg_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_hdg_sb" value="<?php echo get_option('vps_prices_hdg_sb'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Mobile Food Unit/Portable Kitchen</th>
<td align="center">N/A</td>
<td align="center">N/A</td>
<td>$<input type="text" size="20px" name="vps_prices_mfu_esp" value="<?php echo get_option('vps_prices_mfu_esp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_mfu_dsdp" value="<?php echo get_option('vps_prices_mfu_dsdp'); ?>" /></td>
<td>$<input type="text" size="20px" name="vps_prices_mfu_sb" value="<?php echo get_option('vps_prices_mfu_sb'); ?>" /></td>
</tr>
</table>
<h3>Additional Rentals</h3>
<table class="form-table">
<tbody class="vps-form">
<tr valign="top">
<th scope="row">Chair</th>
<td>$<input type="text" name="vps_prices_chair" value="<?php echo get_option('vps_prices_chair'); ?>" /> each</td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Table 3 x 8</th>
<td>$<input type="text" name="vps_prices_table" value="<?php echo get_option('vps_prices_table'); ?>" /> each</td>
</tr>
<tr valign="top">
<th scope="row">Tent 10 x 10</th>
<td>$<input type="text" name="vps_prices_tent" value="<?php echo get_option('vps_prices_tent'); ?>" /> each</td>
</tr>
<tr valign="top" class="alt-row">
<th scope="row">Food Prep Space 10 x 15</th>
<td>$<input type="text" name="vps_prices_foodprep" value="<?php echo get_option('vps_prices_foodprep'); ?>" /> each</td>
</tr>
</tbody>
</table>

<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>

</form>
	</div>
	
<?php

	}

?>
